﻿Public Class GrammarElementList(Of T)
    Private Shared m_lastMaxIndex As Integer = 0
    Private m_elementList As Dictionary(Of Integer, T)

    Public Sub New()
        m_elementList = New Dictionary(Of Integer, T)
    End Sub

    Public Function GetElement(ByVal index As Integer) As T
        If m_elementList.ContainsKey(index) Then
            Contract.GeneralArgumentError("id", "The terminal id has been already assigned to another terminal")
        End If
        Return m_elementList(index)
    End Function

    Public Sub AddElement(ByVal index As Integer, ByVal element As T)

    End Sub
End Class
